package com.jiang.admin;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

/**
 * 调度中心启动类
 * @author jiangyougan 2018年12月2日 下午5:49:06 
 *
 */
@EnableEurekaClient
@SpringBootApplication
@MapperScan("com.jiang.admin.dao")
public class JobAdminApplication {

	public static void main(String[] args) {
		SpringApplication.run(JobAdminApplication.class, args);
	}
	
	/**
	 * 客户端负载均衡
	 * @return
	 */
	@Bean
	@LoadBalanced
	public RestTemplate restTemplate() {
		// + restTemplate 连接配置
		return new RestTemplate();
	}
}
